import React, { Component } from 'react';
import { Button, message } from 'antd';
class login extends Component {
  goPage(type) {
    if (type === 'user') {
      this.props.history.push('/user/index');
    } else {
      this.props.history.push('/admin/index');
    }
    message.success('登录成功');
  }
  render() {
    return (
      <div>
        <h1>我是登录页面</h1>
        <Button onClick={() => this.goPage('user')}>进入用户页面</Button>
        <Button onClick={() => this.goPage('admin')}>进入后台页面</Button>
      </div>
    );
  }
}

export default login;
